Ruby program to find the value of e^value using exp() function

bookmark

print "Enter number: ";
num = gets.chomp.to_f;  

result = Math.exp(num);
print "Result: ",result;

 


Output:

Enter number: -0.9
Result: 0.4065696597405991